<?php
class Data_transportChannelName {
	function transportChannelName($data, $game) {

		if(!is_array($data)) {
			return $data;
		}	
		
		$channel_lang = MooConfig::get("channel_lang.{$game}.en_zh");
		$game_lang = MooConfig::get("game_lang.en_zh");
		
		foreach ($data as $key => $val) {
			$gameEn = $val['game'];
			
			if($gameEn) {
				if(!empty($game_lang[$gameEn])) {
					$data[$key]['game'] = $game_lang[$gameEn];
				}
			}
			
			$channelEn = $val['channel'];
			if($channelEn) {
				if(!empty($channel_lang[$channelEn])) {
					$data[$key]['channel'] = $channel_lang[$channelEn];
				}
			}
		}
		
		return $data;			
		
	}
}